<script setup>
defineProps({
  newMessage: String
});

defineEmits(['send-message', 'update:newMessage']);
</script>

<template>
  <div class="message-input-area">
    <div class="input-container">
      <input
          type="text"
          :value="newMessage"
          @input="$emit('update:newMessage', $event.target.value)"
          placeholder="输入消息..."
          @keyup.enter="$emit('send-message')"
      >
      <button
          class="send-button"
          @click="$emit('send-message')"
      >
        发送 <i class="fas fa-paper-plane"></i>
      </button>
    </div>
  </div>
</template>

<style scoped>
/* 样式已在全局chat.css中定义 */
@import '@/assets/chat.css';
</style>
